Formatting Numeric Output
Introduction
The banded report in the previous example shows the sum of salaries without any formatting (without dollar signs or commas). Instead of printing “Total Sum of Employee Salaries = 1923000" in the summary band, we want to print it as $1,923,000.00.
To format the output, you need to edit the field within the banded report editor. Right-click the field to be formatted to bring up the Edit Expression Field dialog:
Selecting/Creating the Format Mask
To format the field, click the ellipsis button to the right of “Format” which brings up the Edit Format Mask dialog (shown below) that provides options for formatting both numeric and date fields.
You can select one of the pre-existing formats or create your own mask. To select one of the pre-existing formats, double-click the desired format shown within the lower window. The selected option will then appear in the box at the bottom of the window as shown below. You can also create your own format by using the formatting characters described at the top of the Edit Format Mask dialog box.
The field being edited will then be displayed using the format chosen.
However, the example above needs to be modified in order to use the formatting since the field containing the sum also contains a leading string “Total Sum of Employee Salaries”. Argos cannot format the entire field since the expression also contains a string.
Therefore the leading string must be separated from the SUM, and only the SUM field should be formatted.
To accomplish this, edit the field above to remove the leading string. Then apply the format to the SUM function. To replace the leading string you will need to add a new text field and position it immediately to the left of the SUM function.
The figure below shows that there are now two separate fields (the leading string and the SUM field).
The new fields will print as shown below and contains the dollar sign and commas:
The same procedure can be used to format the Sum of Employees’ Salaries within the Group Footer Band.